Tech Report: A Practical Framework for Type Inference Error Explanation
نویسندگان
چکیده
Many languages have support for automatic type inference. But when inference fails, the reported error messages can be unhelpful, highlighting a code location far from the source of the problem. Several lines of work have emerged proposing error reports derived from correcting sets: a set of program points that, when fixed, produce a well-typed program. Unfortunately, these approaches are tightly tied to specific languages; targeting a new language requires encoding a type inference algorithm for the language in a custom constraint system specific to the error reporting tool. We show how to produce correcting set-based error reports by leveraging existing type inference implementations, easing the burden of adoption and, as type inference algorithms tend to be efficient in practice, producing error reports of comparable quality to similar error reporting tools orders of magnitude faster. Many type inference algorithms are already formulated as dual phases of type constraint generation and solving; rather than (re)implementing type inference in an error explanation tool, we isolate the solving phase and treat it as an oracle for solving typing constraints. Given any set of typing constraints, error explanation proceeds by iteratively removing conflicting constraints from the initial constraint set until discovering a subset on which the solver succeeds; the constraints removed form a correcting set. Our approach is agnostic to the semantics of any particular language or type system, instead leveraging the existing type inference engine to give meaning to constraints. [Copyright notice will appear here once ’preprint’ option is removed.]
منابع مشابه
A Prioritization Model for HSE Risk Assessment Using Combined Failure Mode, Effect Analysis, and Fuzzy Inference System: A Case Study in Iranian Construction Industry
The unavailability of sufficient data and uncertainty in modeling, some techniques, and decision-making processes play a significant role in many engineering and management problems. Attain to sure solutions for a problem under accurate consideration is essential. In this paper, an application of fuzzy inference system for modeling the indeterminacy involved in the problem of HSE risk assessm...
متن کاملCompiling the Conceptual Framework of "Garden Archeology"; Functions, Techniques and Challenges
The garden has a social, aesthetic and artistic representational capacity, and is a mix of static and dynamic elements that protect, rebuild and revive with theoretical, practical and technical challenges. "Garden archeology" is considered to be a subclass of archeological activity, which, after the Second World War and especially in recent decades, has been the focus of attention on projects f...
متن کاملStatistical Inference for the Lomax Distribution under Progressively Type-II Censoring with Binomial Removal
This paper considers parameter estimations in Lomax distribution under progressive type-II censoring with random removals, assuming that the number of units removed at each failure time has a binomial distribution. The maximum likelihood estimators (MLEs) are derived using the expectation-maximization (EM) algorithm. The Bayes estimates of the parameters are obtained using both the squared erro...
متن کاملEvaluation of the Efficiency of the Adaptive Neuro Fuzzy Inference System (ANFIS) in the Modeling of the Ionosphere Total Electron Content Time Series Case Study: Tehran Permanent GPS Station
Global positioning system (GPS) measurements provide accurate and continuous 3-dimensional position, velocity and time data anywhere on or above the surface of the earth, anytime, and in all weather conditions. However, the predominant ranging error source for GPS signals is an ionospheric error. The ionosphere is the region of the atmosphere from about 60 km to more than 1500 km above the eart...
متن کاملAn Inference-based Framework for Multistrategy Learning
This chapter describes a general framework for multistrategy learning. One idea of this framework is to view learning as an inference process and to integrate the elementary inferences that are employed by the single-strategy learning methods. Another idea is to base learning on building and generalizing a special type of explanation structure called plausible justification tree which is compos...
متن کامل